Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BitBuilder] Add "Close form" button #109

Closed
wants to merge 1 commit into from

Conversation

ellipsis-dev[bot]
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot commented Oct 27, 2023

Summary:

Issue: #108
Plan feedback: Approved by @nsbradford

Open in Gitpod

Implementation:

  1. Add a new button to the FormDetailPage
    • In the /src/pages/forms/[id].tsx file, add a new button to the left of the existing 'View live form' button. The button should have a white background with red text. The text on the button should be 'Close form' when is_open = true, and 'Open form' when is_open = false.
  2. Add onClick event to the new button
    • In the /src/pages/forms/[id].tsx file, add an onClick event to the new button. When clicked, the button should flip the boolean for the is_open column in the correct row in the database. Use the supabase client for this. The update function should look like this:
const { error } = await supabase
  .from('forms')
  .update({ is_open: !form.is_open })
  .eq('id', form.id)

This will update the is_open status of the form in the database.

Report:

Step Result Details
1
Add a new button to the FormDetailPageAdded a new button to the FormDetailPage
2
Add onClick event to the new buttonAdded onClick event to the new button in the FormDetailPage

Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #108. Then, add the bitbuilder:create label to try again. For more information, check the documentation.

Generated with ❤️ by www.bitbuilder.ai

@ellipsis-dev ellipsis-dev bot requested a review from nsbradford October 27, 2023 20:23
@vercel
Copy link

vercel bot commented Oct 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
talk-form-ai ✅ Ready (Inspect) Visit Preview Oct 27, 2023 8:24pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant